package application;
import java.io.Serializable;

import dataStructures.*;
/**
 * @author Carlos Duarte - 43796
 * @author Rafael Florencio - 43829
 */
public interface TextProcessor extends Serializable {
	/**
	 * add word to dictionary
	 * @param word == input by user
	 */
	public void addWord(String word);
	
	/**
	 * add Text to program
	 * @param idText == identify the text
	 * @param Linetext == line of text
	 */
	public void addText(String idText, int lines, String[] Linetext);
	/**
	 * Remove text from program
	 * @param idText == identify the text
	 */
	public boolean removeText(String idText);
	/**
	 * List text from line to another
	 * If any of the setting parameters is null it prints the entire text
	 * @param idText == identify the text
	 * @param minimum == line to start the resume
	 * @param maximum == line to finish the resume
	 * @return resume of the text
	 */
	public String listText(String idText, int minimum, int maximum);
	
	/**
	 * List by alphabetical order the errors founded in the text
	 * @param idText == identify text
	 * @return List of erros
	 */
	public Iterator<Word> listWordByType(String idText, String type);
	
	/**
	 * How many time a word appear in the text
	 * @param idText == identify the text
	 * @param word == input by user
	 * @return value of times
	 */
	public int countTimes(String idText, String word);
	
	/**
	 * Check if a word exists in the Dictionary
	 * @param word
	 * @return true if it exists, false if not
	 */
	public boolean wordExistsDictionary(String word);
	
	/**
	 * Add a word to the dictionary
	 * @param word
	 */
	public void addDictionary(String word);

	/**
	 * Check if the text already exists
	 * @param id of the text
	 * @return true if it already exists, false if not
	 */
	public boolean hasText(String id);
	
	/**
	 * Check if the text with the id given exists in the database and returns
	 * @param id
	 * @return Text with the given id
	 */
	public Text getText(String id);
	
	
}
